package com.lee.demo.html2pdf.config;

import com.itextpdf.html2pdf.ConverterProperties;
import com.itextpdf.layout.font.FontProvider;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author lyq
 * @time 2019/8/17 13:55
 */
@Configuration
public class Config {

    /**
     * pdf转换配置
     * @return
     */
    @Bean
    public ConverterProperties converterProperties(){
        ConverterProperties converterProperties = new ConverterProperties();
        FontProvider fontProvider = new FontProvider();
        fontProvider.addFont("/font/simsun.ttf");
        converterProperties.setFontProvider(fontProvider);
        return converterProperties;
    }
}
